// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/*!
 * @file Time.cpp
 * This source file contains the implementation of the described types in the IDL file.
 *
 * This file was generated by the tool fastddsgen.
 */

#ifdef _WIN32
// Remove linker warning LNK4221 on Visual Studio
namespace {
char dummy;
}  // namespace
#endif  // _WIN32

#include "Time.h"

#include <fastcdr/Cdr.h>


#include <fastcdr/exceptions/BadParamException.h>
using namespace eprosima::fastcdr::exception;

#include <utility>




Time::Time()
{
}

Time::~Time()
{
}

Time::Time(
        const Time& x)
{
    m_seconds = x.m_seconds;
    m_nanoseconds = x.m_nanoseconds;
}

Time::Time(
        Time&& x) noexcept
{
    m_seconds = x.m_seconds;
    m_nanoseconds = x.m_nanoseconds;
}

Time& Time::operator =(
        const Time& x)
{

    m_seconds = x.m_seconds;
    m_nanoseconds = x.m_nanoseconds;
    return *this;
}

Time& Time::operator =(
        Time&& x) noexcept
{

    m_seconds = x.m_seconds;
    m_nanoseconds = x.m_nanoseconds;
    return *this;
}

bool Time::operator ==(
        const Time& x) const
{
    return (m_seconds == x.m_seconds &&
           m_nanoseconds == x.m_nanoseconds);
}

bool Time::operator !=(
        const Time& x) const
{
    return !(*this == x);
}

/*!
 * @brief This function sets a value in member seconds
 * @param _seconds New value for member seconds
 */
void Time::seconds(
        int32_t _seconds)
{
    m_seconds = _seconds;
}

/*!
 * @brief This function returns the value of member seconds
 * @return Value of member seconds
 */
int32_t Time::seconds() const
{
    return m_seconds;
}

/*!
 * @brief This function returns a reference to member seconds
 * @return Reference to member seconds
 */
int32_t& Time::seconds()
{
    return m_seconds;
}


/*!
 * @brief This function sets a value in member nanoseconds
 * @param _nanoseconds New value for member nanoseconds
 */
void Time::nanoseconds(
        int32_t _nanoseconds)
{
    m_nanoseconds = _nanoseconds;
}

/*!
 * @brief This function returns the value of member nanoseconds
 * @return Value of member nanoseconds
 */
int32_t Time::nanoseconds() const
{
    return m_nanoseconds;
}

/*!
 * @brief This function returns a reference to member nanoseconds
 * @return Reference to member nanoseconds
 */
int32_t& Time::nanoseconds()
{
    return m_nanoseconds;
}


// Include auxiliary functions like for serializing/deserializing.
#include "TimeCdrAux.ipp"

